<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>switch小案例</title>
	<script type="text/javascript">
		//季节案例
		var season=Number(prompt("请输入月份"));
		switch(season){
			case 3: case 4: case 5:
			alert("根据判断这是春季");
			break;
			case 6: case 7: case 8:
			alert("根据判断这是夏季");
			break;
			case 9: case 10: case 11:
			alert("根据判断这是秋季");
			break;
			case 12: case 1: case 2:
			alert("根据判断这是冬季");
			break;
			default:
			alert("您输入的为非法月份，请重新输入");
			break;
		}
	</script>
</head>
<body>

</body>
</html>